
// 引入创建store
import { createStore, combineReducers, applyMiddleware } from 'redux'


//引入redux-devtools-extension
import { composeWithDevTools } from 'redux-devtools-extension'

import createMiddleWare from "redux-saga"
import saga from "./saga"

// 为count服务的reducer
import countReducer from './reducers/count'
import userReducer from './reducers/user'
import person from './reducers/person'
import shopcar from './reducers/shopcar'

const sagaMiddleWare = createMiddleWare()

const allReducer = combineReducers({
  count: countReducer,
  userInfo: userReducer,
  person,
  shopcar
})

const store = createStore(allReducer, composeWithDevTools(applyMiddleware(sagaMiddleWare)))

sagaMiddleWare.run(saga)

export default store